import { defineStore } from 'pinia';

// 添加类型定义
interface DialogState {
  showVoteDialog: boolean;
}

export const useDialogStore = defineStore('dialogStore', {
  state: (): DialogState => ({
    showVoteDialog: false,
  }),

  getters: {},

  actions: {
    /**
     * 控制投票弹窗的显示和隐藏
     * @param visible 是否显示弹窗，默认为true
     */
    toggleVoteDialog(visible: boolean = true) {
      this.showVoteDialog = visible;
    },
  },
});
